﻿

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Model;
using System.Data;
using DAL;

namespace BLL
{
    /// <summary>
    /// 根据学号计算所有题型总分-王荣晓、李芬-2015年11月16日
    /// </summary>
    public class TypeSumFrationBll
    {
        readonly TypesumfrationDal ScoreAdorn = new TypesumfrationDal();

        #region   调用D层计算word题型总分
        /// <summary>
        /// 计算word题型总分
        /// </summary>
        /// <param name="studentinfo"></param>
        /// <returns></returns>
        public DataTable WordSumFration(String studentID, string TimeTamp)
        {
            TypesumfrationDal typesumfrationdal = new TypesumfrationDal();
            return typesumfrationdal.wordsumfrationdal(studentID, TimeTamp);

        }
        #endregion

        #region 选择题成绩汇总

        public DataTable SelectsumFration(String studentID, string TimeTamp)
        {
            TypesumfrationDal typesumfrationdal = new TypesumfrationDal();
            return typesumfrationdal.Selectsumfration(studentID, TimeTamp);
        }
        #endregion

        #region  计算PPT题型总分
        /// <summary>
        /// 计算PPT题型总分
        /// </summary>
        /// <param name="studentinfo"></param>
        /// <returns></returns>
        public DataTable PPTSumFration(String  studentID,string TimeTamp)
        {
            TypesumfrationDal typesumfrationdal = new TypesumfrationDal();
            return typesumfrationdal.pptsumfrationdal(studentID, TimeTamp);

        }

        #endregion

        #region  计算IE题型总分
        /// <summary>
        /// 计算IE题型总分
        /// </summary>
        /// <param name="studentinfo"></param>
        /// <returns></returns>
        public DataTable IESumFration(String studentinfo, string TimeTamp)
        {
            TypesumfrationDal typesumfrationdal = new TypesumfrationDal();
            return typesumfrationdal.IEsumfrationdal(studentinfo, TimeTamp);

        }

        #endregion

        #region  计算windows题型总分
        /// <summary>
        /// 计算windows题型总分
        /// </summary>
        /// <param name="studentinfo"></param>
        /// <returns></returns>
        public DataTable windowsSumFration(String studentID, string TimeTamp)
        {
            TypesumfrationDal typesumfrationdal = new TypesumfrationDal();
            return typesumfrationdal.winsumfrationdal(studentID, TimeTamp);

        }

        #endregion

        #region  计算Excel题型总分
        /// <summary>
        /// 计算Excel题型总分
        /// </summary>
        /// <param name="studentinfo"></param>
        /// <returns></returns>
        public DataTable ExcelSumFration(String studentID, string TimeTamp)
        {
            TypesumfrationDal typesumfrationdal = new TypesumfrationDal();
            return typesumfrationdal.excelsumfrationdal(studentID, TimeTamp);

        }

        #endregion

        #region 汇总每位同学的总成绩--李芬
        public DataTable SumFration(String studentID, string TimeTamp, string ExamModel)
        {
            TypesumfrationDal typesumfrationdal = new TypesumfrationDal();
            return typesumfrationdal.sumfrationdal(studentID, TimeTamp,ExamModel);

        }
        #endregion

        #region 更新数据库+查询数据库ScoreAdorn——薛帅行——2018年12月25号16点54分
        public int addScoreAdorn(ScoreAdornEntity score)
        {
            TypesumfrationDal typesumfrationdal = new TypesumfrationDal();
            return typesumfrationdal.addScoreAdorn(score);
        }

        public DataTable inquiryScore(ScoreEntity score)
        {
            TypesumfrationDal typesumfrationdal = new TypesumfrationDal();
            return typesumfrationdal.inquiryScore(score);
        }


        /// <summary>
        /// 查询当天时间并且没有推送出去所有字段
        /// </summary>
        /// <param name="score"></param>
        /// <returns></returns>
        public DataTable inquiryScoreAdorn(ScoreAdornEntity score)
        {
            TypesumfrationDal typesumfrationdal = new TypesumfrationDal();
            return typesumfrationdal.inquiryScoreAdorn(score);
        }


        public int UpdateScoreAdorn(ScoreAdornEntity score)
        {
            TypesumfrationDal typesumfrationdal = new TypesumfrationDal();
            int a= typesumfrationdal.UpdateScoreAdorn(score);
            return a;
            
        }

        /// <summary>
        /// 用于显示交卷的第一条记录
        /// </summary>
        /// <param name="score"></param>
        /// <returns></returns>
        public List<ScoreAdornEntity> inquiryScoreAdorn_Isinput(ScoreAdornEntity score)
        {            
            return ScoreAdorn.inquiryScoreAdorn_Isinput(score);
        }


        #endregion
    }
}
